package scedu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.scedu.springcloud.entity.Dept;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import scedu.mapper.DeptDao;
import scedu.service.DeptService;

import java.util.List;

@Service
@Slf4j
public class DeptServiceImpl extends ServiceImpl<DeptDao, Dept> implements DeptService {
    @Autowired
    DeptDao dao;
    public int addDept(Dept dept) {
        return dao.insert(dept);

    }

    public Dept queryById(Long id) {
        log.info("传入的id={}",id);
        QueryWrapper<Dept> wrapper = new QueryWrapper<Dept>();
        return dao.selectById(id);

    }

    public List<Dept> queryALL() {
        QueryWrapper<Dept> wrapper = new QueryWrapper<Dept>();


        return dao.selectList(wrapper);

    }
}
